//
// Created by konglinglong on 2020/9/16.
//

#include "../../lib/doctest.h"
#include "../common/appInit.h"
#include "../../common/commDef.h"
#include "../../common/appSyncCtrl.h"
#include "../../../src/ccore/include/commDef.h"

using namespace std;

TEST_SUITE ("SYSTEM_TS")
{
    TEST_CASE ("SYSTEM_TC_BASE")
    {
        UT_AppInit();

        UT_SAVE_ALL_DBG_CODE();
        if (UT_AppSyncIsXxApp(APP_TYPE_RAN))
        {
            UT_WAIT_DBG_CODE_INC(1, APP_TYPE_RAN, RAN_DC_L3_NGAP_SETUP_SUCC);

            UT_WAIT_EXPECT(>, RAN_GET_DBG_CODE(RAN_DC_L2_RECV_TTI_IND), UT_GET_SAVE_DBG_CODE(APP_TYPE_RAN, RAN_DC_L2_RECV_TTI_IND));

            UT_WAIT_EXPECT(>, RAN_GET_DBG_CODE(RAN_DC_L3_CELL_SETUP_SUCC), UT_GET_SAVE_DBG_CODE(APP_TYPE_RAN, RAN_DC_L3_CELL_SETUP_SUCC));

            UT_WAIT_EXPECT(>, RAN_GET_DBG_CODE(RAN_DC_L2_SCH_MIB), UT_GET_SAVE_DBG_CODE(APP_TYPE_RAN, RAN_DC_L2_SCH_MIB));
        }
        if (UT_AppSyncIsXxApp(APP_TYPE_UE))
        {
            UT_WAIT_EXPECT(>, UE_GET_DBG_CODE(UE_DC_L3_CELL_SEARCH_SUCC), UT_GET_SAVE_DBG_CODE(APP_TYPE_UE, UE_DC_L3_CELL_SEARCH_SUCC));
        }
        sleep(2);

//        while(1)
//        {
//            sleep(1);
//        }

        UT_AppFinal();
    }
}

